package test3;

public class Demo5 {
    public static void main(String[] args) {
        Shape shape=new Shape() {
            @Override
            public void Area(double bottom,double height){
                System.out.println(bottom*height);
            }
        };
        System.out.println("矩形的面积");
        shape.Area(3,4);
        Shape shape1=new Shape() {
            @Override
            public void Area(double bottom,double height){
                System.out.println(bottom*height/2);
            }
        };
        System.out.println("三角形的面积");
        shape1.Area(3,4);
    }
}
abstract class Shape{
    public void Area(double bottom,double height){
        System.out.println(bottom*height);
    }
}
